<script setup>
import { ref, reactive, inject, watch,onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();
const axios = inject("axios");

onMounted(() => {
  router.push("/manageCenter/userManage")
})

const menus = [
  { name: "用户管理", path: "/manageCenter/userManage", icon: '<Tools />'},
  { name: "标签管理", path: "/manageCenter/tagManage" },
  { name: "文章管理", path: "/manageCenter/articleManage" },
];

const handleClick = (menu) => {
  router.push(menu.path);
};
</script>

<template>
  <div class="main-panel">
    <div class="menus">
      <div
        v-for="(menu, index) in menus"
        :key="index"
        @click="handleClick(menu)"
      >
        {{ menu.name }}
      </div>
    </div>
    <div
      style="
        padding: 20px;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
      "
    >
      <router-view></router-view>
    </div>
  </div>
</template>

<style scoped>
.main-panel {
  display: flex;
  color: #64676a;
  max-width: 1500px;
  margin: 0, auto;
}

.menus {
  padding: 20px 0;
  box-sizing: border-box;
  line-height: 55px;
  text-align: center;
  width: 180px;
  height: 90vh;
  border-right: 1px solid #dadada;

  div {
    cursor: pointer;
    &:hover {
      color: cornflowerblue;
    }
  }
}

.title {
  font-size: 65px;
  font-weight: bold;
  text-align: right;
  position: flex;
  color: rgba(0, 0, 0, 0.2);
  right: calc((100vw - 1500px) / 2);
  bottom: 20px;
}
</style>
